﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataAccessLayer;

namespace BusinessLayer
{
    public class AddEquip
    {
        public string Equip_ID { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
        public string Description { get; set; }
        public string image { get; set; }
        public string Category { get; set; }

        public AddEquip()
        {
            Equip_ID = "";
            Name = "";
            Price = 0;
            Description = "";
            image = "";
            Category = "";
        }
        public AddEquip(string id, string na, decimal pr, string de, string im, string ca)
        {
            Equip_ID = id;
            Name = na;
            Price = pr;
            Description = de;
            image = im;
            Category = ca;
        }

        public void save_equipment()
        {
            DataAccessLayer.csDAL objdal = new DataAccessLayer.csDAL();
            List<csparameterListType> par = new List<csparameterListType>();

            par.Add(new csparameterListType("@EQUIPMENT_NUMBER", System.Data.SqlDbType.VarChar, Equip_ID));
            par.Add(new csparameterListType("@EQUIPMENT_NAME", System.Data.SqlDbType.VarChar, Name));
            par.Add(new csparameterListType("@PRICE", System.Data.SqlDbType.Decimal, Price));
            par.Add(new csparameterListType("@EQUIPMENT_DESCRIPTION", System.Data.SqlDbType.VarChar, Description));
            par.Add(new csparameterListType("@EQUIPMENT_IMAGE", System.Data.SqlDbType.VarChar, image));
            par.Add(new csparameterListType("@CATEGORY", System.Data.SqlDbType.VarChar, Category));

            objdal.executespreturndr("SAVE_EQUIPMENT", par);
        }
    }
}